package ext.tianma.part.util.updateIBAValues;

import java.io.PrintWriter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * 用于查询部件属性信息写入表格
 * @author laichao_sun
 *
 */
@Controller
@RequestMapping({ "/PartAttribute" })
public class WriteToXlsController {

	
	@RequestMapping(value = "/writeToXls", method = {RequestMethod.POST, RequestMethod.GET })
	public void writeToXls(HttpServletResponse response) throws Exception {
		boolean enforce = wt.session.SessionServerHelper.manager
				.setAccessEnforced(false);
		PrintWriter out = response.getWriter();
		response.setContentType("text/html;charset=UTF-8");
		try {
			String result = WriteToXlsService.queryPart();
			out.print(result);
		} catch (Throwable e) {
			e.printStackTrace();
		} finally {
			wt.session.SessionServerHelper.manager.setAccessEnforced(enforce);
		}
	}
	
	
	
	
	
}
